﻿namespace AladdinGameFramework
{
	public static partial class Utility
	{
		public static partial class Json
		{
			/// <summary>
			/// JSON辅助器接口
			/// </summary>
			public interface IJsonHelper
			{
				/// <summary>
				/// 将对象序列化成Json字符串
				/// </summary>
				/// <param name="obj">要序列化的对象字符串</param>
				/// <returns>序列化后的JSON字符串</returns>
				string ToJson(object obj);

				/// <summary>
				/// Json反序列化
				/// </summary>
				/// <typeparam name="T">对象类型</typeparam>
				/// <param name="json">要反序列化的JSON字符串</param>
				/// <returns>反序列化后的对象</returns>
				T ToObject<T>(string json);
			}
		}
	}
}
